{% extends "samples/sample_main.html" %}
{% load extra_filters %}

{% block content%}
    <div class="slide">
    <h3>Slide {{object.slideID}}:</h3>
    <p><b>Creator:</b> {{object.creator}}</p>
    <p><b>Reference:</b> {{object.reference}}</p>

    <h4>Labelling</h4>
    <table>
    {% for lab in object.labelling.all %}
    <tr class="{% cycle 'odd' 'even' %}">
    <td>{{ lab.structure }}</td><td>{{ lab.dyeName }}</td>
    </tr>
    {% endfor %}
    </table>

    <h4>Slide Tags</h4>

    {%for t in object.tags.all %}
    {{t.tag}},
    {%endfor%}
    <br>

    <h4>Slide Notes</h4>
    {{object.notes}}
    <br>

    </div>
    
    

    <h3>Images</h3>

    <table>
    <thead>
    <tr><th>ID</th><th>Date</th><th>Files</th><th>Tags</th></tr>
    </thead>
    {% for im in object.images.all|dictsort:"timestamp" %}
    {#<tr class="{% cycle 'odd' 'even' %}">#}
    <tr class="{{im.timestamp.date|is_changed}}">
    <td><a href="/images/{{ im.imageID }}">{{im.imageID}}</a></td>
    <td>{{im.timestamp.date|date:"d/m/y"}}</td>
    <td>
        <table>
            <tr>
                <td>
    {%for f in im.files.all|dictsort:"filename" %}
    {%if forloop.last%}
    <img src="/thumbnails/{{f.filename}}?size=100" float="left"/>
    {%endif%}
    {%endfor%}
                </td>
                <td>
    {%for f in im.files.all %}
    {{f.filename}}<br>
    {%endfor%}
                </td>
            </tr>
    </table>
    </td>
    <td>
    {%for t in im.tags.all %}
    {{t.tag|tagify}},
    {%endfor%}
    {%for f in im.files.all %}
    {%for t in f.tags.all %}
    {{t.tag|tagify}},
    {%endfor%}
    {%endfor%}
    </td>
    </tr>
    {% endfor %}
    </table>

{%endblock%}

  